#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv){
    char **tmp = argv;
    char **ttmp = argv;


    printf("argv:\t%p\n", argv);
    printf("tmp:\t%p\n", tmp);
    printf("ttmp:\t%p\n", ttmp);

    putchar('\n');

    for (int i =0; i<argc; ++i) {
        printf("argv[%d]:\t%p %p\n", i, argv+i, *(argv+i));
    }

    putchar('\n');

    for (int i=0; i<argc; ++i) {
        printf("argv[%d]:%s \t %p %p\n", i, *(argv+i), argv+i, *(argv+i));
    }

//return 0;

    int cc =argc;

    putchar('\n');
    putchar('\n');

    int i = 0;
    char *pc = *tmp; //这里这使用pc, 那么下一次再想输入参数列表 [0]是输不出来 的
    char c;
    while (--argc >= 0) {
        printf("argv[%d]: ", i++);
        while (c = *(pc++)) {
            printf("%p %c | ", *tmp-1, c);
            //putchar(c);
        }
        tmp++;  //其实这里不加tmp也行,因为参数字符串数组是连续的内存,...
        puts("");
    }

    puts("");
    printf("ttmp:%p %p\n", ttmp, *ttmp);
    printf("ttmp[0]: %s\n", ttmp[0]);

putchar('\n');

puts("eheh\n");

    for (int i=0; i<cc; ++i) {
        printf("argv[%d]:%s \t %p %p\n", i, *(argv+i), argv+i, *(argv+i));
    }
    /*
    i=0;
    while (*ttmp) {
        printf("argv[%d]:%s\t %p %p\n", i++, *ttmp+(i-1), ttmp+i-1);
    }
    */
}
